package com.sskj.gcc.bean;

import com.sskj.common.util.TimeFormatUtil;

import java.util.Date;
import java.util.List;

public class TradeBean {


    /**
     * code : btc_usdt
     * name : BTC_USDT
     * timestamp : 1566883943864
     * data : [{"dt":1566883953237,"dc":"buy","amount":2,"price":10190.02},{"dt":1566883952532,"dc":"buy","amount":9,"price":10190.02},{"dt":1566883950651,"dc":"buy","amount":25,"price":10190.05}]
     * type : trader
     */

    private String code;
    private String name;
    private long timestamp;
    private String type;
    private List<DataBean> data;



    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }


    public static class DataBean {
        /**
         * dt : 1566883953237
         * dc : buy
         * amount : 2
         * price : 10190.02
         */

        private long dt;
        private String dc;
        private int amount;
        private double price;

        public DataBean(long dt, String dc, int amount, double price) {
            this.dt = dt;
            this.dc = dc;
            this.amount = amount;
            this.price = price;
        }

        public String getAddtime() {
            return TimeFormatUtil.SF_FORMAT_H.format(new Date(dt));
        }

        public void setDt(long dt) {
            this.dt = dt;
        }

        public String getDc() {
            return dc;
        }

        public void setDc(String dc) {
            this.dc = dc;
        }

        public int getAmount() {
            return amount;
        }

        public void setAmount(int amount) {
            this.amount = amount;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        @Override
        public String toString() {
            return "DataBean{" +
                    "dt=" + dt +
                    ", dc='" + dc + '\'' +
                    ", amount=" + amount +
                    ", price=" + price +
                    '}';
        }
    }
}
